package com.likeyoudo.views.utils;

import com.blankj.utilcode.util.ActivityUtils;
import com.likeyoudo.common.constant.LoginInfoSP;
import com.likeyoudo.views.activity.LoginActivity;

/**
 * @author LikeYouDo
 * @date 2024/1/9 19:59
 */
public class LoginUtils {
    /**
     * 退出登录,清空页面堆栈并前往登录页
     */
    public static void logout() {
        // 清除存储的登录数据并且跳转到登录页面
        LoginInfoSP.clearToken();
        ActivityUtils.finishAllActivities(true);
        ActivityUtils.startActivity(LoginActivity.class);
    }
}
